type ReplaceKeys<
  U extends Record<string, any>,
  T,
  Y extends Record<string, any>
> = {
  [P in keyof U]: P extends T ? (P extends keyof Y ? Y[P] : never) : U[P];
};
